import java.util.*;
public class Main {
    public static void main(String[] args)
    {
        Scanner cin = new Scanner(System.in);
        int n = cin.nextInt();

        int arr[][] = new int[n][n];

        for(int i = 0;i<n;i++)
        {
            for(int j = 0;j<n;j++)
            {
                arr[i][j] = cin.nextInt();
            }
        }

        for(int i = 0;i<n;i++)
        {
            for(int j = 0;j<i;j++)
            {
                int t = arr[i][j];
                arr[i][j] = arr[j][i];
                arr[j][i] = t;
            }
        }
        for(int i = 0;i<n;i++)
        {
            for (int j = 0; j < n; j++)
            {
                if(j!=arr[i].length-1)
                System.out.print(arr[i][j] + " ");
                else
                    System.out.print(arr[i][j]);

            }
            System.out.print("\n");
        }

        cin.close();
    }
}